<?php

namespace app\common\model;

use think\Env;
use think\Exception;
use think\Model;

/**
 * 模型
 */
class ServiceTimes extends Model
{

    // 表名
    protected $name = 'service_times';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;


    // 追加属性
    protected $append = [

    ];


    public static function getInfoByMemberId($member_id)
    {
        $info = self::get(['member_id'=>$member_id]);
        if (empty($info)){
            self::create(['member_id'=>$member_id]);
            $info = self::get(['member_id'=>$member_id]);
        }
        return $info;
    }






}
